<script>
import {bindDeviceCidAPI} from "./services/login";
import {getVisitRecordAPI} from "./services/common";
import {deviceInfo} from "./utils/lshttp";

export default {
  onLaunch: function () {
    console.log('App Launch')
    // #ifdef APP-PLUS
    plus.push.getClientInfoAsync(async (info) => {
      let cid = info["clientid"];
      console.log("cid=", cid)
    });
    // #endif
    uni.onPushMessage(res => {
      console.log(res);
      uni.createPushMessage({
        title: "测试标题",
        content:res.data.title
      })
    })

    // 全局记录访问次数
    const deviceObj = {
      device_id: deviceInfo.deviceId,
      platform_type: deviceInfo.platform,
      uniPlatform_type: deviceInfo.uniPlatform,
      deviceBrand: deviceInfo.deviceBrand,
      safeArea: deviceInfo.safeArea,
    }
    getVisitRecordAPI({
      user_id: 0,
      device_id: deviceInfo.deviceId,
      platform_type: deviceInfo.uniPlatform == 'mp-weixin' ? '2' : deviceInfo.uniPlatform == 'app' ? '1': '3',
      device_info: deviceObj
    })
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
}
</script>

<style lang="scss">
/*每个页面公共css */
/*每个页面公共css */
@import 'uview-plus/index.scss';

$nvaBgColor: #FDE52F;
$bgColor: #f6f8f9 !default;
$lgBgColor: #FDE52F;

page {
  font-family: system-ui;
}

swiper,
scroll-view {
  flex: 1;
  height: 100%;
  overflow: hidden;
}
//uniapp样式控制溢出隐藏带省略号
@mixin ellipsis($lines: 1) {
  overflow: hidden;
  word-break: break-all; /* 允许在单词内换行 */
  text-overflow: ellipsis; /* 超出部分省略号 */
  display: -webkit-box; /* 对象作为伸缩盒子模型显示 */
  -webkit-box-orient: vertical; /* 设置或检索伸缩盒对象的子元素的排列方式 */
  -webkit-line-clamp: $lines; /* 显示的行数 */
}
/* 使用 mixin */
.ellipsis-one-line {
  @include ellipsis(1);
}
.ellipsis-two-line {
  @include ellipsis(2);
}
</style>
